<script language="Javascript">


	function setLogin(){
		if( document.flogin.organization != null)
			document.flogin.login.value = document.flogin.organization.value+'-'+document.flogin.user.value;
		else
			document.flogin.login.value = document.flogin.user.value;			
	}
	
	function getLogin(){
		var cookie = '';
		if( document.flogin.organization != null)
			document.flogin.user.value= cookie.substring(cookie.indexOf('-')+1,cookie.length);
		else	
			document.flogin.user.value= cookie;

		if(document.flogin.user.value == '') {
			if(document.flogin.organization != null)
				document.flogin.organization.focus();
			else
				document.flogin.user.focus();
		}
		else
			document.flogin.passwd.focus();
	}
	
 	function openWindow(newWidth,newHeight,link) {					
		newScreenX  = screen.width - newWidth;	
		newScreenY  = 0;		
		Window1=window.open('http://correio.agata6.intraer/'+link,'',"width="+newWidth+",height="+newHeight+",screenX="+newScreenX+",left="+newScreenX+",screenY="+newScreenY+",top="+newScreenY+",toolbar=no,scrollbars=yes,resizable=no");
	}
        var opened = false, vkb = null, text = null; 
        var userstr = navigator.userAgent.toLowerCase(); 
        var safari = (userstr.indexOf('applewebkit') != -1); 
        var gecko  = (userstr.indexOf('gecko') != -1) && !safari; 
        function loadvkbd(){ 
                if(typeof(VKeyboard) == 'function') 
                        keyb_change(); 
                else 
                { 
                        vkbdscript=document.createElement('SCRIPT'); 
                        vkbdscript.src="phpgwapi/js/jscode/vkboards.js"; 
                        vkbdscript.onload = keyb_change; 
                        if(gecko || window.opera || safari) 
                                vkbdscript.onload = keyb_change; 
                        else 
                                setTimeout('keyb_change()',3000);  
                        document.body.appendChild(vkbdscript); 
                } 
        } 
 
   var opened = false, vkb = null, text = null; 
 
   function keyb_change() 
   { 
     opened = !opened; 
 
     if(opened && !vkb) 
     { 
       vkb = new VKeyboard("keyboard",    // container's id 
                           keyb_callback, // reference to the callback function 
                           false,          // create the arrow keys or not? (this and the following params are optional) 
                           false,          // create up and down arrow keys?  
                           false,         // reserved 
                           false,          // create the numpad or not? 
                           "",            // font name ("" == system default) 
                           "14px",        // font size in px 
                           "#FFF",        // font color 
                           "#F00",        // font color for the dead keys 
                           "#83a6ce",        // keyboard base background color 
                           "#28599e",        // keys' background color 
                           "#DDD",        // background color of switched/selected item 
                           "#777",        // border color 
                           "#CCC",        // border/font color of "inactive" key (key with no value/disabled) 
                           "#83a6ce",        // background color of "inactive" key (key with no value/disabled) 
                           "#F77",        // border color of the language selector's cell 
                           true,          // show key flash on click? (false by default) 
                           "#CC3300",     // font color during flash 
                           "#FF9966",     // key background color during flash 
                           "#CC3300",     // key border color during flash 
                           false,         // embed VKeyboard into the page? 
                           true,          // use 1-pixel gap between the keys? 
                           0);            // index(0-based) of the initial layout 
     } 
     else 
       vkb.Show(opened); 
 
     text = document.getElementById("passwd"); 
     text.focus(); 
     if (!(gecko || window.opera || safari)) 
     { 
        document.getElementById('keyboard').style.left = "0px"; 
        document.getElementById('rodape').style.zIndex="-100"; 
     } 
 
   } 
   // Callback function: 
   function keyb_callback(ch) 
   { 
     var val = text.value; 
 
     switch(ch) 
     { 
       case "BackSpace": 
         var min = (val.charCodeAt(val.length - 1) == 10) ? 2 : 1; 
         text.value = val.substr(0, val.length - min); 
         break; 
 
       case "Enter": 
         document.getElementById('loginForm').submit(); 
         break; 
 
       default: 
         text.value += ch; 
     } 
   } 
 function setRange(ctrl, start, end){ 
 } 	

</script>

<h5><i class="icon-envelope"></i> Webmail</h5>
<form id="loginForm" name="flogin" method="post" action="https://correio.cruzex.intraer/login.php?lang=en" target="blank" >
    
    <input type="hidden" name="passwd_type" value="text">
    <input type="hidden" name="account type" value="u">
    <input type="hidden" name="login">  
    <input class="input span2" type="text" name="user" id="user" placeholder="Login" tabindex="4"><br>
    <input class="input span2" type="password" maxlength="50" size="20" name="passwd" tabindex="5" id="passwd" placeholder="<?=$t_senha_login?>">
    <input type="hidden" name="sessionid"  value="e91e7ba1855b021213677b2c099ac968" ><br>
    <input value="<?php echo $t_entrar?>" name="submitit" class="btn btn-primary" tabindex="6" onclick="javascript:setLogin()" type="submit"/>
                
</form>